package 投票;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static int N = 2010;
    static double[][] f = new double[N][N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int cases = 1; cases <= T; cases++) {
            int n = in.nextInt();
            int m = in.nextInt();
            for (int i = 0; i <= n; i++) {
                Arrays.fill(f[i], 0);
            }
            f[1][0] = (double) n / (n + m);
            for (int i = 1; i <= n; i++) {
                for (int j = 0; j < i; j++) {
                    f[i + 1][j] += f[i][j] * (n - i) / (n + m - i - j);
                    f[i][j + 1] += f[i][j] * (m - j) / (n + m - i - j);
                }
            }
            System.out.printf("Case #%d: %.8f\n", cases, f[n][m]);
        }
    }
}
